package com.shrct.businessprocess.customerservice.impl;

import com.shrct.businessprocess.customerservice.RCNonProjectService;
import com.shrct.businessprocess.customerservice.RCNonProjectServiceDAO;
import com.shrct.businessprocess.customerservice.impl.RCNonProjectServiceImpl;
import com.shrct.businessprocess.organization.RCEmployee;
import edu.fudan.langlab.domain.organization.Party;
import edu.fudan.langlab.domain.security.ISystemUserService;
import edu.fudan.mylang.pf.BaseDAOService;
import edu.fudan.mylang.utils.DateUtil;
import java.util.Date;
import org.eclipse.xtext.xbase.lib.ObjectExtensions;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("com.shrct.businessprocess.customerservice.RCNonProjectServiceDAO")
public class RCNonProjectServiceDAOImpl extends BaseDAOService<RCNonProjectService> implements RCNonProjectServiceDAO {
  @Autowired
  private ISystemUserService systemUserService;
  
  public RCNonProjectService create(final Procedure1<? super RCNonProjectService> preinit) {RCNonProjectService rCNonProjectService=RCNonProjectServiceImpl.create(getObjectFactory());
    final Procedure1<RCNonProjectService> _function = new Procedure1<RCNonProjectService>() {
        public void apply(final RCNonProjectService it) {
          preinit.apply(it);
          Party _currentUserAsParty = RCNonProjectServiceDAOImpl.this.systemUserService.getCurrentUserAsParty();
          it.setSales(((RCEmployee) _currentUserAsParty));
          Date _day = DateUtil.today();
          it.setApplyDate(_day);
          it.start();
        }
      };
    RCNonProjectService _doubleArrow = ObjectExtensions.<RCNonProjectService>operator_doubleArrow(rCNonProjectService, _function);
    return _doubleArrow;
  }
}
